<%@ page language="java" pageEncoding="UTF-8"%>
<!-- 这部分是主页头部 -->
	<header role="banner">
			<nav role="navigation" class="navbar navbar-inverse navbar-fixed-top">
				<div class="container">
					<div class="navbar-header">

						<button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".navbar-collapse">
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                        </button>

						<span  class="navbar-brand" style="color: white;">美文驿站</span>
					</div>
					<!--响应式布局导航栏需要用一个div包含着，data-toggle代表预期行为,data-tatrget代表预期目标-->
					<div class="navbar-collapse collapse" style="float: left">
						<ul class="nav navbar-nav nav_margin">
							<li>
								<a href="${_root}/index">主页</a>
							</li>
							<c:if test="${not empty user}">
								<li>
									<a href="${_root}/jsp/person">个人中心</a>
								</li>
							</c:if>
							<c:if test="${sessionScope.user.roleID <= 2}">
								<li><a href="${_root}/admin/index">后台管理</a><li>
							</c:if>
						</ul>
					</div>
					
					<ul class="nav navbar-nav navbar-right">
					<c:choose>
						<c:when test="${not empty user}">
								<li> 
									<a href="#">
									${sessionScope.user.name}
									<c:if test="${sessionScope.user.roleID==2}">
										,您是管理员
									</c:if>
									<c:if test="${sessionScope.user.roleID==1}">
										,您是超级管理员
									</c:if>
									</a>
								</li>
								<li> 
									<a href="${_root}/logout">注销</a>
								</li>	
						</c:when>
						<c:otherwise>
							<li> 
								<a href="${_root}/jsp/login">登录</a>
							</li>
							<li> 
									<a href="${_root}/jsp/register">注册</a>
							</li>
						</c:otherwise>
					</c:choose>
					</ul>
					<form class="navbar-form navbar-right">
						<div class="form-group">
							<input type="text" class="form-control" placeholder="Search">
						</div>
						<button type="submit" class="btn btn-default">Submit</button>
					</form>
					
				</div>
			</nav>
	</header>

